package com.yqg.protection.entity;

import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yqg.protection.cover.AnnounceStateConverter;
import com.yqg.protection.cover.AnnounceTypeConverter;
import com.yqg.protection.cover.LocalDateTimeConverter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * announce 实体类
 *
 * @author zxf
 * @since 2024-10-12
 */
@Getter
@Setter
@ApiModel(value = "Announce对象", description = "")
public class Announce implements Serializable {

    private static final long serialVersionUID = 1L;

    @ExcelProperty(value = "ID", index = 0)
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ExcelProperty(value = "通知人ID", index = 1)
    private Long userId;

    @ExcelProperty(value = "通知人", index = 2)
    @TableField(exist = false)
    @ApiModelProperty("通知人")
    private String username;

    @ExcelProperty(value = "单位ID", index = 3)
    private Long clientId;

    @ExcelProperty(value = "单位名称", index = 4)
    @TableField(exist = false)
    @ApiModelProperty("单位名称")
    private String clientName;

    @ExcelProperty(value = "公告类型", index = 5, converter = AnnounceTypeConverter.class)
    private String type;

    @ExcelProperty(value = "设备或sim卡ID", index = 6)
    private Long equipOrSimId;

    @ExcelProperty(value = "公告内容", index = 7)
    private String content;

    @ExcelProperty(value = "公告状态", index = 8, converter = AnnounceStateConverter.class)
    private String state;

    @ExcelProperty(value = "公告时间", index = 9, converter = LocalDateTimeConverter.class)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime createTime;
}
